<template>
	<view class="go-top">
		<uni-icons @click="backToTop" class="arrow" custom-prefix="iconfont" type="arrow-up" color="#888" size="30">
		</uni-icons>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			backToTop() {
				// 滚动到页面顶部
				uni.pageScrollTo({
					scrollTop: 0
				});
			},
		},
	}
</script>

<style lang="scss">
	.go-top {
		position: fixed;
		bottom: 150rpx;
		right: 10rpx;
		border: 1px solid #888;
		background-color: #fff;
		border-radius: 50%;
		opacity: .5;
		
		&:active{
			opacity: 1;
		}
	}
</style>
